package luafrontend.values;

import luafrontend.exceptions.ConversionException;

public class LuaBool extends LuaValue {
	private boolean bool;
	
	public LuaBool(boolean bool) {
		this.bool = bool;
	}

	public LuaBool asBool() throws ConversionException {
		return this;
	}
	
	public LuaString asString() throws ConversionException {
		return new LuaString("" + bool);
	}
	
	public boolean getBoolean() {
		return bool;
	}
	
	public boolean isNil() {
		return !bool;
	}
	
	@Override
	public String toString() {
		return "" + bool;
	}
}
